{template 'common/header-base'}
<style>
	.system-login{
		/*background: url("./resource/images/bg_login.jpg") center center no-repeat !important;*/
		position: fixed;
		height: 100%;
		top: 0;
		width: 100%;
		background-size: cover !important;
	}
	.login-panel{
		position: absolute;
		top: 47%;
		left: 50%;
		margin: -205px 0 0 -190px;
		z-index: 9;
		background: #fff;
	}
	.footer{
		color: #999 !important;
		background-color: transparent;
		width: 100%;
		position: fixed;
		bottom: 2%;
	}
</style>
	<div class="system-login" style="background: url('{if !empty($_W['setting']['copyright']['background_img'])}{php echo to_global_media($_W['setting']['copyright']['background_img']);}{else}./resource/images/bg_login.jpg{/if}') center center no-repeat">

		<!--<div class="head" style="display: block;">
			<a href="/" class="logo-version">
				<img src="{if !empty($_W['setting']['copyright']['flogo'])}{php echo to_global_media($_W['setting']['copyright']['flogo'])}{else}./resource/images/logo/login-logo.png{/if}" class="logo">
				<span class="version hidden">{IMS_VERSION}</span>
			</a>
			{if !empty($_W['setting']['copyright']['showhomepage'])}
			<a href="{php echo url('account/welcome')}" class="pull-right">首页</a>
			{/if}
		</div>-->
		<div class="login-panel">
			<div class="title">
				<a href="javascript:void(0);">账号/手机登录</a>
			</div>
			<form action="" method="post" role="form" id="form1" onsubmit="return formcheck();" class="we7-form">

				<div class="input-group-vertical">
					<input name="login_type" type="hidden" class="form-control " value="system">
					<input name="referer" type="hidden" value="{$_GPC['referer']}">
					<input name="username" type="text" class="form-control " placeholder="请输入用户名/手机登录">
					<input name="password" id="password" type="password" class="form-control password" placeholder="请输入登录密码">
					<span style="display:none;color:red;">大写锁定已打开</span>
					{if !empty($_W['setting']['copyright']['verifycode'])}
					<div class="input-group">
						<input name="verify" type="text" class="form-control" placeholder="请输入验证码">
						<a href="javascript:;" id="toggle" class="input-group-btn imgverify"><img id="imgverify" src="{php echo url('utility/code')}" title="点击图片更换验证码" /></a>
					</div>
					{/if}
				</div>
				<div class="form-inline" style="margin-bottom: 15px;">
					<div class="pull-right">
						<a href="{url 'user/find-password'}" target="_blank" class="color-default"></a>
					</div>
					<div class="checkbox">
						<input type="checkbox" value="true" id="rember" name="rember">
						<label for="rember">记住用户名</label>
					</div>
				</div>
				<div class="login-submit text-center">
					<input type="submit" id="submit" name="submit" value="登录" class="btn btn-primary btn-block" />
					<div class="text-right">
						{if !$_W['siteclose'] && $setting['register']['open']}
							{if empty($_GPC['login_type']) || $_GPC['login_type'] == 'system'}
							<a href="{url 'user/register'}" class="color-default">立即注册</a>
							{/if}
						{/if}

						{if !$_W['siteclose'] && !empty($_W['setting']['copyright']['mobile_status'])}
							{if $_GPC['login_type'] == 'mobile'}
							<a href="{php echo url('user/register', array('register_type' => 'mobile'))}" class="color-default">立即注册</a>
							{/if}
						{/if}

					</div>
					<input name="token" value="{$_W['token']}" type="hidden" />
				</div>
				{if !empty($setting['thirdlogin']['qq']['authstate']) || !empty($setting['thirdlogin']['wechat']['authstate'])}
				<div class="text-center">
					<span class="color-gray">使用第三方账号登录</span>
					<div class="form-control-static">
						{if !empty($setting['thirdlogin']['qq']['authstate'])}<a href="{$login_urls['qq']}"><img src="./resource/images/qqlogin.png" width="35px"></a>&nbsp;&nbsp;{/if}
						{if !empty($setting['thirdlogin']['wechat']['authstate'])}<a href="{$login_urls['wechat']}"><img src="./resource/images/wxlogin.png" width="35px"></a>{/if}
					</div>
				</div>
				{/if}
			</form>
		</div>

		<div class="container-fluid footer text-center" role="footer">
			<div class="friend-link">
				{$_W['setting']['copyright']['footerright']}
			</div>
			<div class="copyright">
				{if empty($_W['setting']['copyright']['footerleft'])}&copy; 2014-2019 {else}{$_W['setting']['copyright']['footerleft']}{/if}</div>

				{if !empty($_W['setting']['copyright']['icp'])}
				<div>备案号：<a href="http://www.miitbeian.gov.cn" target="_blank">{$_W['setting']['copyright']['icp']}</a></div>
				{/if}
		</div>
		{template 'common/canvas-line'}

	</div>
	<script>
		function detectCapsLock(event) {
			var e = event || window.event;
			var o = e.target || e.srcElement;
			var oTip = o.nextElementSibling;
			var keyCode = e.keyCode || e.switch;
			var isShift = e.shiftKey || (keyCode == 16) || false;
			if (((keyCode >= 65 && keyCode <= 90) && !isShift) || ((keyCode >= 97 && keyCode <= 122) && isShift)) {
				oTip.style.display = '';
			} else {
				oTip.style.display = 'none';
			}
		}
		document.getElementById('password').onkeypress = detectCapsLock;

		function formcheck() {
			if($('#remember:checked').length == 1) {
				cookie.set('remember-username', $(':text[name="username"]').val());
			} else {
				cookie.del('remember-username');
			}
			return true;
		}
		// var h = document.documentElement.clientHeight;
		// if($('.footer').length) {
		// 	h = h - $('.footer').outerHeight();
		// }
		// $(".system-login").css('height',h);
		$('#toggle').click(function() {
			$('#imgverify').prop('src', '{php echo url('utility/code')}r='+Math.round(new Date().getTime()));
			return false;
		});
		{if !empty($_W['setting']['copyright']['verifycode'])}
		$('#form1').submit(function() {
			var verify = $(':text[name="verify"]').val();
			if (verify == '') {
				alert('请填写验证码');
				return false;
			}
		});
		{/if}
	</script>
{template 'common/footer-base'}
